import request from '@/utils/request'

// 查询卖家商品列表
export function listSellerProduct(query) {
  return request({
    url: '/seller/sellerProduct/list',
    method: 'get',
    params: query
  })
}

// 查询卖家商品详细
export function getSellerProduct(id) {
  return request({
    url: '/seller/sellerProduct/' + id,
    method: 'get'
  })
}

// 新增卖家商品
export function addSellerProduct(data) {
  return request({
    url: '/seller/sellerProduct',
    method: 'post',
    data: data
  })
}

// 修改卖家商品
export function updateSellerProduct(data) {
  return request({
    url: '/seller/sellerProduct',
    method: 'put',
    data: data
  })
}

// 删除卖家商品
export function delSellerProduct(id) {
  return request({
    url: '/seller/sellerProduct/' + id,
    method: 'delete'
  })
}

// 获取运费模板列表
export function listsellerFreightTemplate(id) {
  return request({
    url: '/seller/sellerStoreFreightTemplate/selectList?sellerStoreId=' + id,
    method: 'get'
  })
}

// 获取服务模板列表
export function listsellerPromiseTemplate(id) {
  return request({
    url: '/seller/sellerStorePromiseTemplate/selectList?sellerStoreId=' + id,
    method: 'get'
  })
}

// 获取营销方案列表
export function storeActivityList(id) {
  return request({
    url: '/seller/sellerStorePromotionActivity/storeActivityList?storeId=' + id,
    method: 'get'
  })
}

// 同步运费模板列表
export function syncListsellerFreightTemplate(id) {
  return request({
    url: '/AEProduct/getSellerStoreFreightTemplate?sellerId=' + id,
    method: 'get'
  })
}

// 同步服务模板列表
export function syncListsellerPromiseTemplate(id) {
  return request({
    url: '/AEProduct/queryPromiseTemplateById?templateId=-1&sellerId=' + id,
    method: 'get'
  })
}

// 同步营销方案列表
export function selectStorePromotionsTemplate(id) {
  return request({
    url: '/ae/promotionActivity/selectStorePromotions?currentPage=1&storeId=' + id,
    method: 'get'
  })
}

// 发布商品到速卖通
export function addSellerStoreProduct(query) {
  return request({
    url: '/seller/sellerStoreProduct/publish',
    method: 'post',
    params: query
  })
}

// 根据类目id和商家id获取有权限品牌
export function brandList(query) {
  return request({
    url: '/aliexpress/category/getBrandById',
    method: 'get',
    params: query
  })
}

// 获取智能定价模板
export function listSellerStorePriceTemplate() {
  return request({
    url: '/seller/sellerStorePriceTemplate/selectList',
    method: 'get'
  })
}

// AI制图
export function aiDesign(query) {
  return request({
    url: '/gather/sfondoImageTask/add',
    method: 'post',
    data: query
  })
}

// 系统制图
export function sysImageMerge(query) {
  return request({
    url: '/gather/collectProduct/imageMerge',
    method: 'get',
    params: query
  })
}

// 刊登日志
export function myPublishingList(query) {
  return request({
    url: '/gather/collectProductPublishTask/myPublishingList',
    method: 'get',
    params: query
  })
}

// 判断是否为人民币
export function isRmb(query) {
  return request({
    url: '/seller/sellerStoreEmpowerExtend/isRmb',
    method: 'get',
    params: query
  })
}


// 根据店铺id查询分组
export function queryAvailableGroupsByStoreId(query) {
  return request({
    url: '/gather/gather/sellerStoreGroup/queryAvailableGroupsByStoreId',
    method: 'get',
    params: query
  })
}

// 从速卖通同步商品分组
export function queryStoreGroupList(query) {
  return request({
    url: '/gather/gather/sellerStoreGroup/queryStoreGroupList',
    method: 'get',
    params: query
  })
}
